var Fight,
  __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (i, s) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, i) {
              t.__proto__ = i;
            }) ||
          function (t, i) {
            for (var s in i)
              Object.prototype.hasOwnProperty.call(i, s) && (t[s] = i[s]);
          })(i, s);
      };
      return function (i, s) {
        function n() {
          this.constructor = i;
        }
        if ("function" != typeof s && null !== s)
          throw new TypeError(
            "Class extends value " + String(s) + " is not a constructor or null"
          );
        t(i, s),
          (i.prototype =
            null === s
              ? Object.create(s)
              : ((n.prototype = s.prototype), new n()));
      };
    })();
!(function (t) {
  var i = (function (t) {
    function i() {
      var i = t.call(this) || this;
      (i.pivotX = 20), (i.state = 0), (i.mouseEnabled = !1);
      var s = new List();
      return (
        (s.itemRender = e),
        (s.repeatX = 3),
        (s.repeatY = 3),
        s.pos(-10, -8),
        (s.vScrollBarSkin = ""),
        (s.renderHandler = new Handler(i, i.updateItem)),
        (i.buffList = s),
        i.addChild(s),
        i
      );
    }
    return (
      __extends(i, t),
      (i.prototype.refresh = function (t) {
        if (t != this.state) {
          this.state = t;
          var s,
            n = [],
            e = i.markMap,
            r = Dictionary.skill;
          for (var a in e)
            (t & parseInt(a)) > 0 && ((s = r[e[a]]), n.push(s.short));
          this.buffList.array = n;
        }
      }),
      (i.prototype.refreshOne = function (t, s) {
        var n = i.skillMap[s];
        if (n && (t & n) != (this.state & n)) {
          (this.state & n) > 0
            ? (this.state = this.state & (255 - n))
            : (this.state = this.state | n);
          var e = Dictionary.skill[s];
          if (e) {
            var r = this.buffList.array,
              a = !1;
            if (null == r) r = [];
            else
              for (var o = 0, p = r; o < p.length; o++) {
                if (p[o] == e.short) {
                  a = !0;
                  break;
                }
              }
            var u = (t & n) > 0;
            if (a && !u) {
              var c = r.lastIndexOf(e.short);
              r.splice(c, 1);
            }
            !a && u && r.push(e.short);
          }
        }
      }),
      (i.prototype.updateItem = function (t, i) {
        t.init(t.dataSource);
      }),
      (i.isBuff = function (t) {
        return i.skillMap[t];
      }),
      (i.skillMap = {
        12: 1,
        5: 2,
        11: 8,
        14: 16,
        19: 32,
        18: 64,
        15: 128,
        101: 256,
        102: 512,
        103: 1024,
      }),
      (i.markMap = {
        1: 12,
        2: 5,
        8: 11,
        16: 14,
        32: 19,
        64: 18,
        128: 15,
        256: 101,
        512: 102,
        1024: 103,
      }),
      i
    );
  })(Laya.Sprite);
  t.FightBuff = i;
  var s = Laya.Box,
    n = Laya.Image,
    e = (function (t) {
      function i() {
        var s = t.call(this) || this;
        s.size(i.WID, i.HEI);
        var e = new n();
        return e.size(i.WID, i.HEI), (s.images = e), s.addChild(e), s;
      }
      return (
        __extends(i, t),
        (i.prototype.init = function (t) {
          "围" == t
            ? (this.images.skin = "comp/st_wei.png")
            : "毒" == t
            ? (this.images.skin = "comp/st_du.png")
            : "封" == t
            ? (this.images.skin = "comp/st_feng.png")
            : "固" == t
            ? (this.images.skin = "comp/st_gu.png")
            : "乱" == t
            ? (this.images.skin = "comp/st_luan.png")
            : "灭" == t
            ? (this.images.skin = "comp/st_mie.png")
            : "速" == t
            ? (this.images.skin = "comp/st_su.png")
            : "晕" == t
            ? (this.images.skin = "comp/st_yu.png")
            : "竭" == t
            ? (this.images.skin = "comp/st_jie.png")
            : "禁" == t && (this.images.skin = "comp/st_jin.png");
        }),
        (i.WID = 25),
        (i.HEI = 25),
        i
      );
    })(s);
})(Fight || (Fight = {}));
